package com.hospital.hospitalsystem.modules.medicine.service;

import com.hospital.hospitalsystem.modules.medicine.dao.entity.HospitalMedicalEntity;
import com.hospital.hospitalsystem.modules.medicine.dao.mapper.HospitalMedicalMapper;
import com.hospital.hospitalsystem.modules.medicine.dto.CheckStorageReq;
import com.hospital.hospitalsystem.modules.medicine.dto.CheckStorageRsp;
import com.hospital.hospitalsystem.modules.user.dto.BuyOrderReq;
import com.hospital.hospitalsystem.modules.user.dto.MedicalListReq;
import com.hospital.hospitalsystem.modules.user.dto.MedicalRsp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author qiancheng@cqxyy.net
 * @date 2023/4/4
 */
@Component
public class HospitalMedicalService {

    @Autowired
    private HospitalMedicalMapper hospitalMedicalMapper;

    public void insertSelective(HospitalMedicalEntity hospitalMedicalEntity) {
        hospitalMedicalMapper.insertSelective(hospitalMedicalEntity);
    }

    public void deleteByExample(Example example) {
        hospitalMedicalMapper.deleteByExample(example);
    }

    public List<HospitalMedicalEntity> selectByExample(Example example) {
        return hospitalMedicalMapper.selectByExample(example);
    }

    public void updateByExampleSelective(HospitalMedicalEntity hospitalMedicalEntity,Example example) {
        hospitalMedicalMapper.updateByExampleSelective(hospitalMedicalEntity,example);
    }

    public List<MedicalRsp> selectByList(MedicalListReq req) {
        return hospitalMedicalMapper.selectByList(req);
    }

    public List<CheckStorageRsp> checkStorage(CheckStorageReq req) {
        return hospitalMedicalMapper.checkStorage(req);
    }

    public List<HospitalMedicalEntity> buyMedical(BuyOrderReq req) {
        return hospitalMedicalMapper.buyMedical(req);
    }
}
